tests/export: Guard with check for libarchive
authorAlex Kiernan <alex.kiernan@gmail.com>
Thu, 24 Oct 2019 18:07:30 +0000 (19:07 +0100)
committerAlex Kiernan <alex.kiernan@gmail.com>
Thu, 24 Oct 2019 18:08:59 +0000 (19:08 +0100)
If we are built without libarchive support, this test fails:

  error: This version of ostree is not compiled with libarchive support
  ...
  ERROR: tests/test-export.sh - too few tests run (expected 5, got 0)
  ERROR: tests/test-export.sh - exited with status 1

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
tests/test-export.sh

index e1a0346c6874ef457a325aad74e4cf5e0023e7c7..17f7c0247d917f238ed57fd072db223f2417beb8 100755 (executable)
 
 set -euo pipefail
 
+if ! ostree --version | grep -q -e '- libarchive'; then
+    echo "1..0 #SKIP no libarchive support compiled in"
+    exit 0
+fi
+
 . $(dirname $0)/libtest.sh
 
 setup_test_repository "archive"